package com.jdd.modules.parkcar.util;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jdd.common.util.excel.web.entity.vo.NormalExcelConstants;
import com.jdd.modules.parkcar.entity.ParkCarStored;
import com.jdd.modules.parkcar.service.IParkCarStoredService;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author liuyaowen
 * @date 2021-05-04
 */
public class ParkCarStoreUtil {
    public final Integer PARK_CAR_STORE_MAX_FEE = 10000;

    public ModelAndView addDataToModelAndViewStoreCar(ModelAndView mv, IParkCarStoredService iParkCarStoredService, QueryWrapper<ParkCarStored> queryWrapper, int pageNo, int pageSize) {
        Page<ParkCarStored> page = new Page<>(pageNo, pageSize);
        IPage<ParkCarStored> iPage = iParkCarStoredService.page(page, queryWrapper);
        mv.addObject(NormalExcelConstants.DATA_LIST, iPage.getRecords());
        return mv;
    }
}
